<?php
namespace app\common\validate\tysj;

class BusinessLicense extends Base {
	/**
     * 验证规则
     */
    protected $rule = [
    	'lock'        => 'require',
        'id'          => 'require',
        'uid'         => 'require',
        'sid'         => 'require',
        'photo'       => 'require|max:100',
        'code'        => 'require|max:48',
        'merchant'    => 'require|max:32',
        'corporation' => 'require|max:32'
    ];
    /**
     * 提示消息
     */
    protected $message = [
    	'lock.require'        => '验证规则场景不存在',
        'id.require'          => '营业执照ID不能为空',
        'id.lock'             => '禁止直接编辑该数据',
    	'uid.require'         => '用户ID不能为空',
        'sid.require'         => '店铺ID不能为空',
        'sid.isUser'          => '店铺不属于您',
        'sid.unique'          => '营业执照信息已经填写',
        'sid.isShow'          => '店铺暂未开张',
        'photo.require'       => '营业执照地址不能为空',
        'photo.max'           => '营业执照地址不能超过100个字符',
        'code.require'        => '营业执照号码不能为空',
        'code.max'            => '营业执照号码不能超过32个字符',
        'merchant.require'    => '商户名称不能为空',
        'merchant.max'        => '商户名称不能超过32个字符',
        'corporation.require' => '法人信息不能为空',
        'corporation.max'     => '法人信息不能超过32个字符'
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'save'        => ['uid', 'sid' => 'require|unique:app\common\model\tysj\BusinessLicense|isUser:tysj\Store', 'photo', 'code', 'merchant', 'corporation'],
        'look'        => ['sid' => 'require|isShow:tysj\Store'],
        'info'        => ['sid' => 'require|isUser:tysj\Store']
    ];
}